package org.xx.armory.spring5.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.xx.armory.spring5.security.SimplePasswordEncoder;
import org.xx.armory.spring5.wxwork.WxWorkClient;

@Configuration
@ConditionalOnWebApplication
@AutoConfigureBefore(value = SecurityAutoConfiguration.class)
public class ArmoryWebSecurityAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public PasswordEncoder passwordEncoder() {
        return new SimplePasswordEncoder();
    }
}
